//
//  NetworkTools.m
//  单例
//
//  Created by fangyuan ding on 2019/12/20.
//  Copyright © 2019年 fangyuan ding. All rights reserved.
//

#import "NetworkTools.h"

@implementation NetworkTools
+ (instancetype)sharedNetworkToos{
    static id instance = nil;
    //线程同步，保证线程安全
    @synchronized (self) {
        if(instance == nil){
            instance = [[self alloc]init];
        }
    }
    return instance;
}
+ (instancetype)sharedNetworkToosOnce{
    static id instance = nil;
    //dispatch_once 线程安全
    dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        if(instance == nil){
            instance = [[self alloc]init];
        }
    });
    return instance;
}
@end
